#pragma once
#include <QWidget>
#include <functional>

class MyDx11;
struct ID3D11Device;
struct ID3D11DeviceContext;
struct ID3D11Texture2D;

class ShowScreenWindow : public QWidget {
	Q_OBJECT

public:
	explicit ShowScreenWindow(QWidget* parent = nullptr);
	void addMonitor(int _monitor_width, int _monitor_height);
	void removeMonitor();
	void rend() const;
	void copyMonitor(ID3D11Device* _device, ID3D11DeviceContext* _context, ID3D11Texture2D* _monitor_texture);
	void renderToTexture(bool _draw_cursor);
	void copyFromRenderTarget(uint8_t* _buffer, size_t _size);
	void copyToRenderTarget(uint8_t* _buffer, size_t _size);
	~ShowScreenWindow();
public:
	QPaintEngine* paintEngine() const { return nullptr; }
public:
	void paintEvent(QPaintEvent* event);
	void resizeEvent(QResizeEvent* event);

	void initD3D();
	void resizeD3D();

private:
	MyDx11* m_d3d11 = nullptr;
};
